<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Unit3.java',
	'<{subtitle}>' => 'Written in <span title="Programming 1">CS 1102</span> of <a href="http://www.uopeople.edu/">University of the People</a>, finalised on 2017-04-26',
	'<{copyright year}>' => '2017',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<h2>Source code:</h2>
<blockquote>
<pre><code>/*
 * Copyright (C) 2017 Alex Yst
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
 */
package unit3;

/**
 *
 * @author Alex Yst
 */
public class Unit3 {
	public static void main(String[] arguments) {
		TextIO.readFile(&quot;icecream.dat&quot;);
		int total = 0;
		int Strawberry = 0;
		while(!TextIO.eof()) {
			total ++;
			if(TextIO.getln().equals(&quot;Strawberry&quot;)) {
				Strawberry++;
			}
		}
		System.out.println(&quot;Total cones sold: &quot; + total);
		System.out.println(&quot;Strawberry cones sold: &quot; + Strawberry);
		double percent = 100.0 * Strawberry / total;
		System.out.println(&quot;Percentage of sales that were strawberry cones: &quot; + percent + &quot;%&quot;);
	}
}</code></pre>
</blockquote>
<h2>Output:</h2>
<blockquote>
<pre>run:
Total cones sold: 374
Strawberry cones sold: 48
Percentage of sales that were strawberry cones: 12.834224598930481%
BUILD SUCCESSFUL (total time: 0 seconds)</pre>
</blockquote>
END
);
